<include file="../Public:header" />
<style type="text/css">

    /*table和分页样式*/
    .table a{
        text-decoration:none;
    }
    .paging_simple_numbers{
        margin-top: 10px;
        height: 32px;
        text-align: right;
    }
    .paging_simple_numbers a,.paging_simple_numbers .current{
        border: 1px solid #aaa;
        padding: 5px 10px;
        margin-right: 5px;
    }
    .paging_simple_numbers .current{
        background: #5A98DE;
        color:#fff;
        border: 1px solid #5A98DE;
    }
    .paging_simple_numbers a:hover {
        background:#5a98de;
        color:#fff
    }
</style>

<block name="css"></block>
<title><block name='title'></block></title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    <volist name="__NAVIGATION__" id="navigation">
        <neq name="i" value="1"><span class="c-gray en">&gt;</span></neq> {$navigation}
    </volist>
</block>
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <block name='body'></block>
</div>
<include file="../Public:footer" />
<script>
    var alert_error=function (msg,fuc) {
        layer.msg(msg, {icon: 2},fuc);
    };
    var alert_success=function (msg,fuc) {
        layer.msg(msg, {icon: 1},fuc);
    };
    /**
     * 公共操作方法
     * @param  string tip 操作提示文本
     * @param  string id  操作数据编号
     * @param  string url 操作执行地址
     * @return {[type]}     [description]
     */
    var action=function(tip,value,url,pk){
        layer.confirm(tip,function(index){
            pk = pk||'id';
            $.post(url, $.parseJSON('{ "'+pk+'": '+value+'}'), function(d) {
                if(d.status==1){
                    alert_success(d.info,function () {
                        location.reload();
                    });
                }else{
                    alert_error(d.info);
                }
            });
        });
    }

    /**
     * 公共批量删除方法
     * @param  string pk       操作数据主键
     * @return {[type]}     [description]
     */
    function dels(pk, actionName) {
        pk = pk||'id';
        var action_name = actionName || 'delete';
        var list=$('.table input[type="checkbox"]:checked');
        if(list.size()>0){
            var ids=[];
            $.each(list,function(index, el) {
                if($(el).val() == '') return true;
                ids.push(parseInt($(el).val()));
            });
            action('确认要批量删除吗？','[' + ids + ']',"{:U('"+ action_name + "')}", pk);
        }else{
            layer.alert('请选择要删除的数据！');
        }
    }

    /**
     * 公共删除方法
     * @param  string id_Value 操作数据id
     * @param  string pk       操作数据主键
     * @return {[type]}     [description]
     */
    function del(value, pk){
        pk = pk||'id';
        action('确认要删除吗？',value,"{:U('delete')}",pk);
    }
</script>
<block name="js"></block>
</body>
</html>





